package com.itheima.reggie.common;

/**
 * @author gakki
 * @create 2022/5/2 14:59
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();


    /**
     * 设置当前线程id
     * @param id
     */
    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    /**
     * 获取当前线程id
     */
    public static Long getCurrentId() {
         return threadLocal.get();
    }
}
